use "flooding and firm performance_panel data_Plos one_final.dta" 


*****************Code to create regression tables*******************


//Table 2. Main regression on firm performance (Tobin's Q, ROA)

egen city_year=group(citycode year)  //create city-year level for clustering standard errors

//Panel B, regression with full controls
reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

gen sampleq=e(sample) //construct consistent sample for regression without controls

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

gen sampleroa=e(sample)


//Panel A, regression without controls
reghdfe qq floodratio if sampleq==1, absorb (code year) cluster (city_year)
outreg2 using table2.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio if sampleroa==1, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)


//Table 3. Matching sample based on geographic distance

//Panel A. Within 100 kilometers

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if match100==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

replace sampleq=e(sample) //construct consistent sample for regression without controls

reghdfe qq floodratio if match100==1 & sampleq==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if match100==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

replace sampleroa=e(sample)

reghdfe froa floodratio if match100==1 & sampleroa==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

//Panel B. Within 50 kilometers

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if match50==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio if match50==1 & sampleq==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if match50==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio if match50==1 & sampleroa==1, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

//Table 4. Interaction term regressions

/*
gen manufacture=0
replace manufacture=1 if industry==3

reghdfe qq c.floodratio##i.manufacture size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)*/

drop ppedummy
bys year: quantiles ppeassets, gen (ppedummy) nq(2)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if ppedummy==1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if ppedummy!=1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)



reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if marketization<8.5, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if marketization>8.5, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)


reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if sa>-4, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if sa<-4, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if soe==1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if soe!=1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if subs>9, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if subs<9.1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)



reghdfe froa floodratio size leverage largest lnboard indep soe ocf cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if ppedummy==1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if ppedummy!=1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if marketization<8.5, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if marketization>8.5, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)


reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if sa>-4, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if sa<-4, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if soe==1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if soe!=1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if subs>9, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if subs<9.1, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)







//Table 5. Sudden flooding vs expected flooding

//sudden flooding is defined as those cities if the flood ratio is 2-standard-deviation larger than the cities' average flood ratio during our sample period

bys citycode: egen sdflood=sd(floodratio)
bys citycode: egen meanflood=mean(floodratio)

gen sudden=0
replace sudden=1 if floodratio>meanflood + sdflood*2

gen suddenflood=sudden*floodratio
gen normalflood=floodratio
replace normalflood=0 if suddenflood!=0

reghdfe qq suddenflood normalflood size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table5.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) drop (i.year) bdec(3) sdec(3)

replace sampleq=e(sample)
reghdfe qq suddenflood normalflood if sampleq==1, absorb (code year) cluster (city_year)
outreg2 using table5.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) drop (i.year) bdec(3) sdec(3)

reghdfe froa suddenflood normalflood size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table5.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) drop (i.year) bdec(3) sdec(3)

replace sampleroa=e(sample)
reghdfe froa suddenflood normalflood if sampleroa==1, absorb (code year) cluster (city_year)
outreg2 using table5.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) drop (i.year) bdec(3) sdec(3)


//Table 6. Firm investment policy**********************************
/*企业投资行为结果*/

reghdfe rd floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ppeassets floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe fma floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe fmapayment floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe fnonaffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe faffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb(code year) cluster (city_year)
outreg2 using table6.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

//Table 7. Firm financial policy
/*企业融资行为结果*/

xtset code year

reghdfe f.leverage floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table7.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe marketlev floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe maturity floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f.cashholding floodratio size leverage largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

//Table 8. Firm payout policy
/*企业payout行为结果*/

reghdfe div floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table8.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.dps floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table8.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe divbook floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table8.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe shareback floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table8.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe backdummy floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table8.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

//Table 9. Firm CEO pay and pay-performance regression
/*CEO pay的结果*/
xtset code year
gen lagros=l.indros
winsor2 lagros, replace cut (1 99)

reghdfe ceopay floodratio size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ceopay c.floodratio##c.l.indroa size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ceopay c.floodratio##c.lagros size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ceopay flooddummy size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ceopay flooddummy##c.l.indroa size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe ceopay flooddummy##c.lagros size leverage largest lnboard indep soe ocf standard growth valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table9.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)


//Table 10. City-level regressions (using the other file "GDP regression_2003-2019").

xtreg gdpgrowth lngdp lnincome l.gdpgrowth l.floodratio i.year, fe cluster (citycode)
outreg2 using table8.doc, replace addtext(Year fixed effects, Yes, City fixed effects, Yes) bdec(3) sdec(3)

xtreg employgrowth lngdp lnincome l.gdpgrowth l.floodratio i.year, fe cluster (citycode)
outreg2 using table8.doc, append addtext(Year fixed effects, Yes, City fixed effects, Yes) bdec(3) sdec(3)

xtivreg2 gdpgrowth lngdp lnincome l.gdpgrowth (l.floodratio = l.rain), fe cluster (citycode)
outreg2 using table8.doc, append addtext(Year fixed effects, Yes, City fixed effects, Yes) bdec(3) sdec(3)

xtivreg2 employgrowth lngdp lnincome l.gdpgrowth (l.floodratio = l.rain), fe cluster (citycode)
outreg2 using table8.doc, append addtext(Year fixed effects, Yes, City fixed effects, Yes) bdec(3) sdec(3)




*********************Appendix results********************


//Appendix Table A2. Flooding and firm performance: Excluding Beijing, Shanghai, Shenzhen and Guangzhou
/*citycode in our sample, Beijing 110000; Shanghai 310000; Guangzhou 440100; Shenzhen 440300*/

drop if citycode==110000 | citycode==440100 | citycode==440300| citycode==310000

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea2.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea2.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

//Appendix Table A3. Firms with vs without insurance payment

replace insurancepay=1 if insurancepay!=0 & insurancepay!=.

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if f.insurancepay==1, absorb (code year) cluster (code)
outreg2 using tablea3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if f.insurancepay==1, absorb (code year) cluster (code)
outreg2 using tablea3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if f.insurancepay!=1, absorb (code year) cluster (code)
outreg2 using tablea3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth if f.insurancepay!=1, absorb (code year) cluster (code)
outreg2 using tablea3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)


//Appendix Table A4. Results on firm performance measured in year t, t+2, t+3

/*Firm performance measured in year t*/
reghdfe l.qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe l.froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

/*Firm performance measured in year t+2*/
reghdfe f.qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f.froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

/*Firm performance measured in year t+3*/
reghdfe f2.qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f2.froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea4.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)


//Appendix Table A5. Results on firm policies measured in year t, t+2, t+3

/*Investment policy measured in year t*/

reghdfe l.rd floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.ppeassets floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.fma floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.fmapayment floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.fnonaffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.faffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea5.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)


/*Investment policy measured in year t+2*/

reghdfe f.rd floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.ppeassets floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.fma floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.fmapayment floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.fnonaffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.faffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

/*Investment policy measured in year t+3*/

reghdfe f2.rd floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.ppeassets floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.fma floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.fmapayment floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.fnonaffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.faffect floodratio size leverage largest lnboard indep soe ocf qq age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table2.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

/*Financial policy measured in year t*/

reghdfe leverage floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe l.marketlev floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe l.maturity floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe cashholding floodratio size leverage largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

/*Financial policy measured in year t+2*/

reghdfe f2.leverage floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f.marketlev floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f.maturity floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f2.cashholding floodratio size leverage largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

/*Financial policy measured in year t+3*/

reghdfe f3.leverage floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f2.marketlev floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f2.maturity floodratio size largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f3.cashholding floodratio size leverage largest lnboard indep soe ocf ros growth div age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table3.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

/*Payout policy measured in year t*/

reghdfe l.div floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.dps floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.divbook floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.shareback floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe l.backdummy floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

/*Payout policy measured in year t+2*/

reghdfe f.div floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.dps floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.divbook floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.shareback floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f.backdummy floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

/*Payout policy measured in year t+3*/

reghdfe f2.div floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, replace addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f3.dps floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.divbook floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.shareback floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

reghdfe f2.backdummy floodratio size leverage largest lnboard indep soe ocf standard growth ros valuebookratio age tenure ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using table4.doc, append addtext(Year fixed effect, Yes, Firm fixed effect, Yes) bdec(3) sdec(3)

//Tabel A6. IV regression results, Lewbel (2012)
xi: ivreg2h qq size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth i.year i.code (floodratio =), r cluster (city_year)
outreg2 using tablea7.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

xi: ivreg2h returna size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth i.year i.code (floodratio =), r cluster (city_year)
outreg2 using tablea7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

xi: ivreg2h froa size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth i.year i.code (floodratio =), r cluster (city_year)
outreg2 using tablea7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

//Appendix Table A7. Alternative measures of firm performance (ROS, Sales growth rate, and Earnings per share)

reghdfe returna floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea7.doc, replace addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe fros floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe f.growth floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)

reghdfe eps floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth, absorb (code year) cluster (city_year)
outreg2 using tablea7.doc, append addtext(Year fixed effects, Yes, Firm fixed effects, Yes) bdec(3) sdec(3)




//Figure. Drawing the trend of firm performance between firms with and without flooding (using Excel)

gen treat=0
tsset code year
replace treat=1 if floodratio>l.floodratio //Following reviewer's sugggestion to define treatment sample as those flood ratio increases

drop if treat==0 & floodratio!=0

tsset code year
gen lag2q=l2.qq
bys year treat: egen lmean_q=mean(lag2q) //year prior flooding

tsset code year
gen lagq=l.qq
bys year treat: egen mean_q=mean(lagq) //flooding year

bys year treat: egen fmean_q=mean(qq) //year after flooding

bys treat: egen allfmean=mean(fmean_q)
bys treat: egen allmean=mean(mean_q)
bys treat: egen alllmean=mean(lmean_q)

duplicates drop treat allfmean allmean alllmean, force
//Then, copy the data to the Excel and draw the graph trend




gen treat=0
tsset code year
replace treat=1 if floodratio>l.floodratio //Following reviewer's sugggestion to define treatment sample as those flood ratio increases

drop if treat==0 & floodratio!=0

tsset code year
gen lag2roa=l2.froa
bys year treat: egen lmean_roa=mean(lag2roa) //year prior flooding

tsset code year
gen lagroa=l.froa
bys year treat: egen mean_roa=mean(lagroa) //flooding year

bys year treat: egen fmean_roa=mean(froa) //year after flooding

bys treat: egen allfmean=mean(fmean_roa)
bys treat: egen allmean=mean(mean_roa)
bys treat: egen alllmean=mean(lmean_roa)

duplicates drop treat allfmean allmean alllmean, force
//Then, copy the data to the Excel and draw the graph trend


//Figure 3. Sensitivity of OLS results****************** Cinelli and Hazlett (2019)

sensemakr qq floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth i.year, treat(floodratio) benchmark (ocf) contourplot 

sensemakr froa floodratio size leverage largest lnboard indep soe ocf fixed cashholding age tenure standard valuebookratio ret_lag lngdp lnincome gdpgrowth i.year, treat(floodratio) benchmark (ocf) contourplot
